testsuite: Warn if a necessary env var is missing
authorMatthias Clasen <mclasen@redhat.com>
Tue, 11 Feb 2020 19:09:24 +0000 (14:09 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 12 Feb 2020 17:18:59 +0000 (12:18 -0500)
Better to warn if we know why the tests are
going to fail. Saves headscratching later.

testsuite/gtk/icontheme.c

index c6c7b638b17719b73d7cefa90724eb109728bbee..85c120d68b309ad50a2a28636f886a24c831c048 100644 (file)
@@ -773,9 +773,18 @@ test_nonsquare_symbolic (void)
   g_object_unref (info);
 }
 
+static void
+require_env (const char *var)
+{
+  if (g_getenv (var) == NULL)
+    g_warning ("Some tests require %s to be set", var);
+}
+
 int
 main (int argc, char *argv[])
 {
+  require_env ("G_TEST_SRCDIR");
+
   gtk_test_init (&argc, &argv);
 
   g_test_add_func ("/icontheme/basics", test_basics);